<div class="content-titulo">
    <h2><?php echo $this->titulo;?></h2>
    <div class="content-btn">
        <a href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit')); ?>">+</a>
    </div>
</div>


<div class="content-list">
    
<?php foreach ($this->result as $row) {  
    $grad = new Sistema_Model_DbTable_Gradecor();
    $grad = $grad->fetchRow('GRC_ID = ' . $row->GRC_ID);
?>
    <div class="item" style="height:100px">    
        <div class="col" style="width: 150px">
            <p><strong>Código: <?php echo $row->GCP_ID; ?></strong></p>
            <p><strong>Título: </strong><?php echo $row->GCP_NOM; ?></p>
            <p><strong>Status: </strong><?php echo tools::returnStatus($row->GCP_STA); ?></p>
        </div>
        <div class="col" style="width: 200px">
            <p><strong>Grade: </strong><?php echo $grad->GRC_NOM; ?></p>
            <p><strong>Cor: </strong><?php 
				$img = glob('public/upload/cor_pri/'.$row->GCP_ID.'.*');
				if(!isset($img[0])) echo $row->GCP_COR; 
			?></p>
			<ul class="grade_cor">
                <?php if(!isset($img[0])) { ?>
				<li style="background-color: #<?php echo $row->GCP_COR; ?>"></li>
				<?php } else{ 
					echo '<img src="'.$this->urlbase.'/'.$img[0].'" style="border: 1px solid #333;" />';
				 } ?>
            </ul>
        </div>
        
        <div class="col" style="width: 150px">
            
        </div>
        
       
        
        <div class="btn-actions" style="padding-top: 10px;">
            <?php if($this->per_edt){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'id' => $row->GCP_ID)); ?>">Editar</a><?php }?>
            <?php if($this->per_del){?><a class="btn-pdr" href="javascript:void(0);" onclick="list_delete('<?php echo $this->controller; ?>', <?php echo $row->GCP_ID ?>, $(this));">Deletar</a><?php }?>            
        </div>

      </div>
    <?php } ?>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>

